<template>
  <div>
    父组件
    <button @click="infoClick">info:{{ info }}</button>
    <hr />
    <Son :info.sync="info"></Son>
  </div>
</template>

<script setup>
import { reactive, ref, triggerRef } from "vue";
import Son from "./Son.vue";
// 这里只能使用ref不能使用reactive
const info = ref({
  name: "jd",
  age: 18,
  msg: {
    count: 0,
  },
});
const infoClick = () => {
  info.value.msg.count++;
};
</script>

<style scoped>
button {
  padding: 20px 20px;
  background-color: pink;
}
</style>
